﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Test_Console
{
    class Program
    {
        public enum Suits
        {
            Spades = 0,
            Clubs = 1 << 4,
            Hearts = 2 << 4,
            Diamonds = 3 << 4
        }
        public enum Rank
        {
            Ace = 0,
            Two = 1,
            Three = 2,
            Four = 3,
            Five = 4,
            Six = 5,
            Seven = 6,
            Eight = 7,
            Nine = 8,
            Ten = 9,
            Jack = 10,
            Queen = 11,
            King = 12
        }

        static void Main(string[] args)
        {
            foreach (Suits s in Enum.GetValues(typeof(Suits)))
            {
                Console.WriteLine((int)s);
            }
            int test = (int)Rank.Ace ^ (int)Suits.Spades;
            Console.WriteLine(test.ToString() + ": " + Convert.ToString(test,2));


            int Kd = 60;
            int As = 0;

            Console.WriteLine((Kd << 2) + ": " + Convert.ToString(Kd << 2,2));
            
            //Console.WriteLine(GetSuit(test).ToString());
            //Console.WriteLine(GetRank(test).ToString());

            Console.Read();
        }

        public static Suits GetSuit(int card)
        {
            //card.
            //int byteShift = card >> 4;
            return (Suits)((card >> 4) << 4);
        }

        public static Rank GetRank(int card)
        {
            return (Rank)(card & 15); //Bitwise and mask 1111 (15) to remove first 2 bits 
        }
    }
}
